home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / orbit / datarate.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-12-05  |  4.0 KB  |  136 lines

  1. VERSION 2.00
  2. Begin Form datarate 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Data Sample Rate"
  6.    ClientHeight    =   2535
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1485
  9.    ClientWidth     =   4845
  10.    ControlBox      =   0   'False
  11.    Height          =   2940
  12.    Left            =   1035
  13.    LinkMode        =   1  'Source
  14.    LinkTopic       =   "Form1"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   2535
  18.    ScaleWidth      =   4845
  19.    Top             =   1140
  20.    Width           =   4965
  21.    Begin SSPanel SSPanel1 
  22.       AutoSize        =   3  'AutoSize Child To Panel
  23.       BevelInner      =   1  'Inset
  24.       BevelWidth      =   2
  25.       ForeColor       =   &H00000000&
  26.       Height          =   615
  27.       Left            =   840
  28.       TabIndex        =   0
  29.       Top             =   1800
  30.       Width           =   3015
  31.       Begin CommandButton Command1 
  32.          Cancel          =   -1  'True
  33.          Caption         =   "O.K."
  34.          Height          =   405
  35.          Left            =   105
  36.          TabIndex        =   1
  37.          Top             =   105
  38.          Width           =   2805
  39.       End
  40.    End
  41.    Begin TextBox ti 
  42.       Height          =   375
  43.       Left            =   2400
  44.       TabIndex        =   7
  45.       Top             =   1320
  46.       Width           =   2175
  47.    End
  48.    Begin TextBox mr 
  49.       Height          =   375
  50.       Left            =   2400
  51.       TabIndex        =   6
  52.       Top             =   840
  53.       Width           =   2175
  54.    End
  55.    Begin TextBox pps 
  56.       Height          =   375
  57.       Left            =   2400
  58.       TabIndex        =   5
  59.       Top             =   360
  60.       Width           =   2175
  61.    End
  62.    Begin SSPanel SSPanel2 
  63.       AutoSize        =   3  'AutoSize Child To Panel
  64.       BevelInner      =   1  'Inset
  65.       BevelWidth      =   2
  66.       ForeColor       =   &H00000000&
  67.       Height          =   735
  68.       Left            =   120
  69.       TabIndex        =   8
  70.       Top             =   120
  71.       Width           =   735
  72.       Begin PictureBox Picture1 
  73.          Height          =   525
  74.          Left            =   105
  75.          Picture         =   DATARATE.FRX:0000
  76.          ScaleHeight     =   495
  77.          ScaleWidth      =   495
  78.          TabIndex        =   9
  79.          Top             =   105
  80.          Width           =   525
  81.       End
  82.    End
  83.    Begin Label Label5 
  84.       AutoSize        =   -1  'True
  85.       BackColor       =   &H00C0C0C0&
  86.       Caption         =   "Current Time Interval"
  87.       Height          =   195
  88.       Left            =   480
  89.       TabIndex        =   4
  90.       Top             =   1320
  91.       Width           =   1800
  92.    End
  93.    Begin Label Label3 
  94.       AutoSize        =   -1  'True
  95.       BackColor       =   &H00C0C0C0&
  96.       Caption         =   "Min Rate"
  97.       Height          =   195
  98.       Left            =   1560
  99.       TabIndex        =   3
  100.       Top             =   840
  101.       Width           =   780
  102.    End
  103.    Begin Label Label1 
  104.       AutoSize        =   -1  'True
  105.       BackColor       =   &H00C0C0C0&
  106.       Caption         =   "Points P/Sec."
  107.       Height          =   195
  108.       Left            =   1080
  109.       TabIndex        =   2
  110.       Top             =   360
  111.       Width           =   1200
  112.    End
  113. Dim mrate As Single
  114. Sub Command1_Click ()
  115.     If Val(pps.text) > mrate Then
  116.         Beep
  117.         pps.text = Str$(mrate)
  118.         MsgBox "Sample Rate Too Large", 48, "Orbital"
  119.         Exit Sub
  120.     End If
  121.     planet.text7.text = ti.text
  122.     samplerate = Val(pps.text)
  123.     datarate.Hide
  124.     Unload datarate
  125. End Sub
  126. Sub Form_Load ()
  127.     ti.text = planet.text7.text
  128.     mrate = (1 / Val(ti.text)) / 20
  129.     mr.text = Str$(mrate) + " Points p/s"
  130.     pps.text = Str$(mrate)
  131.     If ti.text = "" Then
  132.         MsgBox "Please enter a Time Interval", 48, "Orbital"
  133.         Exit Sub
  134.     End If
  135. End Sub
  136.